//
//  SinaLoginOC.m
//  YeKa
//
//  Created by Gina on 15/10/15.
//  Copyright © 2015年 Gina. All rights reserved.
//

#import "SinaLoginOC.h"
#import "UMSocial.h"
#import "YeKa-swift.h"


@implementation SinaLoginOC

+(void)sinaLogin{
    ;
    UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToSina];
    LoginViewController *vc = [[LoginViewController alloc] init];
    snsPlatform.loginClickHandler(vc,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
        
        //          获取微博用户名、uid、token等
        if (response.responseCode == UMSResponseCodeSuccess) {
            
//            UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToSina];
//            NSLog(snsAccount);
            
            
            
            /*
            NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
            
            
             //获取accestoken以及新浪用户信息，得到的数据在回调Block对象形参respone的data属性
             [[UMSocialDataService defaultDataService] requestSnsInformation:UMShareToSina  completion:^(UMSocialResponseEntity *response){
             NSLog(@"SnsInformation is %@",response.data);
             }];
             */
            
            //NSNotificationCenter.defaultCenter().postNotificationName("gameOverNotification", object: title)
            
        }else{
            // 授权失败。
            
        }
    
    
    });
    
}

@end
